package com.itheima.homework.dao;

import com.itheima.homework.pojo.Student;

import java.util.ArrayList;
import java.util.List;

public interface StudentDao {

    List<Student> STUDENTS = new ArrayList<Student>() {
        {
            add(new Student("zhangsan", 18, 1, "12346"));
            add(new Student("lisi", 11, 2, "12346"));
            add(new Student("wanger", 20, 1, "12346"));
            add(new Student("mazi", 25, 2, "12346"));
        }
    };

    /**
     * 根据用户名查询学生
     *
     * @param username
     * @return
     */
    Student selectOneByUsername(String username);

    /**
     * 新增一个学生
     *
     * @param student
     * @return
     */
    void insertOne(Student student);

    /**
     * 根据用户名更新信息
     *
     * @param student
     */
    void updateByUsername(Student student);

    /**
     * 获取所有学生信息
     *
     * @return
     */
    List<Student> selectList();

    /**
     * 批量删除
     *
     * @param usernameList
     */
    void deleteBatch(List<String> usernameList);
}
